#pragma once

#include "typedefs.h"
#include "controls.h"

namespace img { class bitmap; }

namespace outline {

/// fills interior of B-spline with true, other pixels are reset to false state,
/// param bmp must be preresized
template <typename R>
void render(controls<R> const & ctrls, img::bitmap & bmp);

/// fast outlines mask with contour consisting from given number of Bezier polynomials,
/// then fills resulting B-spline to obtain new mask
template <typename R>
void decrease_mask_freedom(
	img::bitmap & bmp,
	//parameters
	uint n, ///< number of nodes = degree_of_freedom
	bool smooth_contour, ///< type of all junctions
	guide_params<R> const & params,
	//in & out
	controls<R> & ctrls, ///< initially empty ctrls lead to setting node points on uniform distance along the contour
	//attraction: each node and control point may have attractor to which it's pulled with relative force 'traction'
	std::vector< point<R> > const * attractors = 0,
	std::vector<R> const * tractions = 0 //0 <= traction <= 1; 0 is absence of traction, 1 - control is fixed in attractor
);

} //namespace outline
